﻿using PPI.Client.Interface;
using PPI.Client.Utils;

namespace PPI.Client.Presenter
{
    public class SplashStartupPresenter
    {
        private ISplashStartup m_View;

        public SplashStartupPresenter(ISplashStartup view)
        {
            m_View = view;
        }

        public void CheckIsInstanceAlreadyRunning()
        {
            if (!SingleApplication.Run())
            {
                m_View.CloseApplication("One instance of the application is already running.");
            }
        }

        public void CheckInternetConnection()
        {
            try
            {
                System.Net.IPHostEntry objIPHE = System.Net.Dns.GetHostByName("www.dev-poleposition.com");
            }
            catch
            {
                m_View.CloseApplication("Internet connection not available.");

            }
        }

        public void LoadCacheData()
        {
            LCacheDataSingleton m_cache = LCacheDataSingleton.Instance;
            LCacheDistributionDataSingleton m_Distribution_Cache = LCacheDistributionDataSingleton.Instance;
        }
    }
}
